package svc

import (
	"go-zero-mall/app/admin/cmd/api/internal/config"
	"go-zero-mall/app/admin/cmd/rpc/admin"

	"github.com/zeromicro/go-zero/zrpc"
)

type ServiceContext struct {
	Config   config.Config
	AdminRpc admin.Admin
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config:   c,
		AdminRpc: admin.NewAdmin(zrpc.MustNewClient(c.AdminRpc)),
	}
}
